import * as actionTypes from './constants';
import { fromJS } from "immutable";
import { getBannerRequest, getRecommendListRequest } from "../../../api/request";


export const changeRecommendList = (data: any) => {return ({
    type: actionTypes.CHANGE_RECOMMEND_LIST,
    data: fromJS(data)
})};


export const getRecommendList = () => {
    return (dispatch: any) => {
        getRecommendListRequest().then((recommendListData: any) => {dispatch(changeRecommendList(recommendListData.result))})
        .catch((error) => console.log("推荐歌单数据传输错误", error));
    };
};

